class ApplicationController < ActionController::Base
  protect_from_forgery
	
	helper_method :current_admin_session, :current_admin , :admin_authenticated?
	before_filter :getProjects ,:getPrograms 

	private
		def current_admin_session
 	 		return @current_admin_session if defined?(@current_admin_session)
 	 		@current_admin_session = AdminSession.find
		end

		def current_admin
 	 		@current_admin = current_admin_session && current_admin_session.record
		end
		
		def getPrograms
		
		@allPrograms= Program.all
		
		end
		
		def getProjects
		
		@allProjects= Project.all
		
		end
		
		def admin_authenticated?
    if(current_admin.nil?)
    	return false
    else 
    	return true
    end
  end
		
	
end
